import React, { Component } from 'react';
import axios from 'axios'
import Item from '../components/Item/Item.jsx'
class Index extends Component {
    constructor(props){
        super(props);
        this.state = {
          musics:[]
        }
      }
    render() {
        
        return (
            <div >
                <Item data={this.state.musics} ></Item>
            </div>
        );
    }
    componentDidMount(){
        axios.get("http://122.112.161.135:3000/top/playlist?cat=华语").then(res=>{
            this.setState({
                musics:res.data.playlists
            })  
        })
    }
}

export default Index;
